function param=min2mod(param,matind)
% ======================================================================
% MIN2MOD.m 
% Inverse of MOD2MIN.m 
%
% function param=min2mod(param,matind); 

% Transforms the coefficients from the minimization to the function called 
% for the computation.  
% Inputs 
% -------
% matind   [ Index |aa | bb | cc ] 
% Index    if =1 than a paramter bounded to the interval ( a, b)
%          trasformed such that in the interval ( -inf,inf ) 
%          if =2 take logs such that also interval (-inf,inf )
%          Set b = 0 
%          if = 0 parameter is not transformed 
%          cc column of ones 
% Output 
% -------
% Transformed parameters 
% Modified 6/18/03 
% ======================================================================
aa=matind(:,2); 
bb=matind(:,3); 
cc=matind(:,4); 
ii=1; 
for ii=1:length(param); 
    if matind(ii,1) == 1 
        param(ii)=0.5*( aa(ii) + bb(ii) ) + 0.5*( bb(ii) - aa(ii) )*...
            cc(ii)*param(ii) / sqrt( 1 + (cc(ii)^2) * (param(ii)^2) );      
    elseif matind(ii,1) == 2 
        param(ii) = aa(ii) + exp( (param(ii)-bb(ii)) * cc(ii) );      
    end
end